package app.beit.finportal.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name="fin_accounts")
@SequenceGenerator(allocationSize=1, name="seqHibernateName", sequenceName="seq_fin_accounts")
public class Account extends BaseEntity {

	@Column(name="username", nullable=false, length=20)
	private String username;
	
	@Column(name="password", nullable=false, length=50)
	private String password;
	
	@Column(name="title_name", length=20)
	private String titleName;
	
	@Column(name="fullname", length=200)
	private String fullname;
	
	@Column(name="tel", length=15)
	private String tel;
	
	@Column(name="email", length=50)
	private String email;
	
	@Column(name="role", nullable=false, length=10)
	private String role;
	
	@Column(name="status", nullable=false, precision=1, scale=0)
	private Integer status;
	
	@OneToMany(fetch=FetchType.LAZY, mappedBy="createdAccount")
	private List<News> lstCreatedNews;
	@OneToMany(fetch=FetchType.LAZY, mappedBy="updatedAccount")
	private List<News> lstUpdatedNews;
 
	public List<News> getLstCreatedNews() {
		return lstCreatedNews;
	}

	public void setLstCreatedNews(List<News> lstCreatedNews) {
		this.lstCreatedNews = lstCreatedNews;
	}

	public List<News> getLstUpdatedNews() {
		return lstUpdatedNews;
	}

	public void setLstUpdatedNews(List<News> lstUpdatedNews) {
		this.lstUpdatedNews = lstUpdatedNews;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getTitleName() {
		return titleName;
	}

	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}

	public String getFullname() {
		return fullname;
	}

	public void setFullname(String fullname) {
		this.fullname = fullname;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "Account [username=" + username + ", password=" + password
				+ ", titleName=" + titleName + ", fullname=" + fullname
				+ ", tel=" + tel + ", email=" + email + ", role=" + role
				+ ", status=" + status + "]";
	}
		
}
